#include<stdio.h>
#include<time.h>
#include<stdlib.h>
#include<unistd.h>
#include"process.h"
const int P  = 50; //速度波动
double once = 0.1; // 速度基数
double totol = 100.0; //任务总量

int main()
{
  srand(time(NULL));
  double current = 0;
  double speed = (rand()%P+1) * once;
  while(current < totol)
  {
   // double speed = (rand()%P + 1) * once;

    current += speed;
    if(current >= totol) current = totol;

   //printf("%lf.%lf\r",current,totol);
   //flush(stdout);
   
   //加载进度条
   process(current , totol);
  }
  printf("\n");
  return 0;
}
